1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module sourceview.Hover; 26 27 private import gobject.ObjectG; 28 private import sourceview.HoverProviderIF; 29 private import sourceview.c.functions; 30 public import sourceview.c.types; 31 32 33 /** 34 * Interactive tooltips. 35 * 36 * `GtkSourceHover` allows a [class@View] to provide contextual information. 37 * When enabled, if the user hovers over a word in the text editor, a series 38 * of registered [iface@HoverProvider] can populate a [class@HoverDisplay] 39 * with useful information. 40 * 41 * To enable call [method@View.get_hover] and add [iface@HoverProvider] 42 * using [method@Hover.add_provider]. To disable, remove all registered 43 * providers with [method@Hover.remove_provider]. 44 * 45 * You can change how long to wait to display the interactive tooltip by 46 * setting the [property@Hover:hover-delay] property in milliseconds. 47 */ 48 public class Hover : ObjectG 49 { 50 /** the main Gtk struct */ 51 protected GtkSourceHover* gtkSourceHover; 52 53 /** Get the main Gtk struct */ 54 public GtkSourceHover* getHoverStruct(bool transferOwnership = false) 55 { 56 if (transferOwnership) 57 ownedRef = false; 58 return gtkSourceHover; 59 } 60 61 /** the main Gtk struct as a void* */ 62 protected override void* getStruct() 63 { 64 return cast(void*)gtkSourceHover; 65 } 66 67 /** 68 * Sets our main struct and passes it to the parent class. 69 */ 70 public this (GtkSourceHover* gtkSourceHover, bool ownedRef = false) 71 { 72 this.gtkSourceHover = gtkSourceHover; 73 super(cast(GObject*)gtkSourceHover, ownedRef); 74 } 75 76 77 /** */ 78 public static GType getType() 79 { 80 return gtk_source_hover_get_type(); 81 } 82 83 /** */ 84 public void addProvider(HoverProviderIF provider) 85 { 86 gtk_source_hover_add_provider(gtkSourceHover, (provider is null) ? null : provider.getHoverProviderStruct()); 87 } 88 89 /** */ 90 public void removeProvider(HoverProviderIF provider) 91 { 92 gtk_source_hover_remove_provider(gtkSourceHover, (provider is null) ? null : provider.getHoverProviderStruct()); 93 } 94 }